<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActionView::Base</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActionView::Base</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/plugins/active_scaffold/lib/extensions/action_view_rendering_rb.html">
                vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb
                </a>
        <br />
                <a href="../../files/vendor/plugins/active_scaffold/lib/extensions/generic_view_paths_rb.html">
                vendor/plugins/active_scaffold/lib/extensions/generic_view_paths.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000075">initialize_with_generic_paths</a>&nbsp;&nbsp;
      <a href="#M000074">partial_pieces</a>&nbsp;&nbsp;
      <a href="#M000073">render_with_active_scaffold</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000075" class="method-detail">
        <a name="M000075"></a>

        <div class="method-heading">
          <a href="#M000075" class="method-signature">
          <span class="method-name">initialize_with_generic_paths</span><span class="method-args">(*args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000075-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/extensions/generic_view_paths.rb, line 17</span>
17:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_with_generic_paths</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
18:     <span class="ruby-identifier">initialize_without_generic_paths</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
19:     <span class="ruby-ivar">@finder</span>.<span class="ruby-identifier">controller</span> = <span class="ruby-ivar">@controller</span>
20:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000074" class="method-detail">
        <a name="M000074"></a>

        <div class="method-heading">
          <a href="#M000074" class="method-signature">
          <span class="method-name">partial_pieces</span><span class="method-args">(partial_path)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000074-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb, line 60</span>
60:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">partial_pieces</span>(<span class="ruby-identifier">partial_path</span>)
61:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">partial_path</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">'/'</span>)
62:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">partial_path</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">partial_path</span>)
63:       <span class="ruby-keyword kw">else</span>
64:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">controller_path</span>, <span class="ruby-identifier">partial_path</span>
65:       <span class="ruby-keyword kw">end</span>
66:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000073" class="method-detail">
        <a name="M000073"></a>

        <div class="method-heading">
          <a href="#M000073" class="method-signature">
          <span class="method-name">render_with_active_scaffold</span><span class="method-args">(*args, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Adds two rendering options.
</p>
<h2>render :super</h2>
<p>
This syntax skips all template overrides and goes directly to the provided
<a href="../ActiveScaffold.html">ActiveScaffold</a> templates. Useful if
you want to wrap an existing template. Just call super!
</p>
<h2>render :active_scaffold =&gt; #{controller.to_s}, options = {}+</h2>
<p>
Lets you embed an <a href="../ActiveScaffold.html">ActiveScaffold</a> by
referencing the controller where it&#8216;s configured.
</p>
<p>
You may specify options[:constraints] for the embedded scaffold. These
constraints have three effects:
</p>
<pre>
  * the scaffold's only displays records matching the constraint
  * all new records created will be assigned the constrained values
  * constrained columns will be hidden (they're pretty boring at this point)
</pre>
<p>
You may also specify options[:conditions] for the embedded scaffold. These
only do 1/3 of what constraints do (they only limit search results). Any
format accepted by ActiveRecord::Base.find is valid.
</p>
<p>
Defining options[:label] lets you completely customize the list title for
the embedded scaffold.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000073-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb, line 25</span>
25:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_with_active_scaffold</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
26:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:super</span>
27:         <span class="ruby-identifier">options</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">||</span> {}
28:         <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:locals</span>] <span class="ruby-operator">||=</span> {}
29: 
30:         <span class="ruby-identifier">known_extensions</span> = [<span class="ruby-identifier">:erb</span>, <span class="ruby-identifier">:rhtml</span>, <span class="ruby-identifier">:rjs</span>, <span class="ruby-identifier">:haml</span>]
31:         <span class="ruby-comment cmt"># search through call stack for a template file (normally matches on first caller)</span>
32:         <span class="ruby-comment cmt"># note that we can't use split(':').first because windoze boxen may have an extra colon to specify the drive letter. the</span>
33:         <span class="ruby-comment cmt"># solution is to count colons from the *right* of the string, not the left. see issue #299.</span>
34:         <span class="ruby-identifier">template_path</span> = <span class="ruby-identifier">caller</span>.<span class="ruby-identifier">find</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">known_extensions</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">c</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">':'</span>)[<span class="ruby-value">-3</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">'.'</span>).<span class="ruby-identifier">last</span>.<span class="ruby-identifier">to_sym</span>) }
35:         <span class="ruby-identifier">template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">template_path</span>).<span class="ruby-identifier">split</span>(<span class="ruby-value str">'.'</span>).<span class="ruby-identifier">first</span>
36:         <span class="ruby-identifier">active_scaffold_config</span>.<span class="ruby-identifier">template_search_path</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">active_scaffold_template_path</span><span class="ruby-operator">|</span>
37:           <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">template_path</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">active_scaffold_template_path</span>
38:           <span class="ruby-identifier">active_scaffold_template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">active_scaffold_template_path</span>, <span class="ruby-identifier">template</span>)
39:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">render</span>(<span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">active_scaffold_template</span>, <span class="ruby-identifier">:locals</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:locals</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@finder</span>.<span class="ruby-identifier">file_exists?</span> <span class="ruby-identifier">active_scaffold_template</span>
40:         <span class="ruby-keyword kw">end</span>
41:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>[<span class="ruby-identifier">:active_scaffold</span>]
42:         <span class="ruby-identifier">require</span> <span class="ruby-value str">'digest/md5'</span>
43:         <span class="ruby-identifier">options</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>
44: 
45:         <span class="ruby-identifier">remote_controller</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:active_scaffold</span>]
46:         <span class="ruby-identifier">constraints</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:constraints</span>]
47:         <span class="ruby-identifier">conditions</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:conditions</span>]
48:         <span class="ruby-identifier">eid</span> = <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:controller</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">remote_controller</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">constraints</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">conditions</span>.<span class="ruby-identifier">to_s</span>)
49:         <span class="ruby-identifier">session</span>[<span class="ruby-node">&quot;as:#{eid}&quot;</span>] = {<span class="ruby-identifier">:constraints</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">constraints</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">conditions</span>, <span class="ruby-identifier">:list</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-identifier">:label</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>[<span class="ruby-identifier">:label</span>]}}
50:         <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:params</span>] <span class="ruby-operator">||=</span> {}
51:         <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:params</span>].<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">:eid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">eid</span>
52: 
53:         <span class="ruby-identifier">render_component</span> <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">remote_controller</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'table'</span>, <span class="ruby-identifier">:params</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:params</span>]
54:       <span class="ruby-keyword kw">else</span>
55:         <span class="ruby-identifier">render_without_active_scaffold</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
56:       <span class="ruby-keyword kw">end</span>
57:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>